/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：TestMain.c
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-04-20
Function List ：
Description   ：main function
******************************************************/

#include <stdio.h>  // for printf
#include "TrieTree.h"

// main function
int main(void) {
    TrieTree T = NULL;

    T = Initialize();

    if (IsEmpty(T)) {
        printf("TrieTree is empty!\n");
    } else {
        printf("TrieTree is not empty!\n");
    }

    T = Insert("string", T);
    T = Insert("strcmp", T);
    T = Insert("strcpy", T);
    T = Insert("strcat", T);
    T = Insert("strstr", T);

    if (IsEmpty(T)) {
        printf("TrieTree is empty!\n");
    } else {
        printf("TrieTree is not empty!\n");
    }

    if (Search("string", T)) {
        printf("Search element string in trie tree!\n");
    } else {
        printf("Can not search element string in trie tree!\n");
    }

    if (Search("trietree", T)) {
        printf("Search element trietree in trie tree!\n");
    } else {
        printf("Can not search element trietree in trie tree!\n");
    }

    if (TrieStartsWith("str", T)) {
        printf("Search starts with str in trie tree!\n");
    } else {
        printf("Can not search starts with str in trie tree!\n");
    }

    if (TrieStartsWith("cat", T)) {
        printf("Search starts with cat in trie tree!\n");
    } else {
        printf("Can not search starts with cat in trie tree!\n");
    }

    return 0;
}

// EOF

